<template>
	<view class="avatar" :style="{width: width, height: height}">
		<image class="avatar-image" :style="{width: width, height: height}" :src="getUrl" mode="aspectFill"></image>
	</view>
</template>

<script>
	export default {
		name:"avatar",
		data() {
			return {
				
			};
		},
		props: {
			url: {
				type: String,
				default: '/static/avatar.jpeg'
			},
			width: {
				type: String,
				default: '160rpx'
			},
			height: {
				type: String,
				default: '160rpx'
			},
		},
		computed: {
			getUrl() {
				return this.url;
			}
		}
	}
</script>

<style lang="scss" scoped>
.avatar {
	overflow: hidden;
	.avatar-image {
		border-radius: 100%;
	}
}
</style>